On Applying Program Transformation to Implement Suspension-Based Tabling in Prolog

نویسندگان

  • Ricardo Rocha
  • Cláudio Silva
  • Ricardo Lopes
چکیده

A common approach used to include tabling support into existing Prolog systems is to modify and extend the low-level engine. Although this approach is ideal for run-time efficiency, it is not easily portable to other Prolog systems as engine level modifications are rather complex and time consuming. A different approach is to apply source level transformations to a tabled program and then use external tabling primitives to provide direct control over the search strategy. We propose a suspension-based tabling mechanism based on program transformation that uses the C interface of the Yap Prolog system to implement the tabling primitives. The program transformation module is fully written in Prolog. The tabling primitives module implements a local scheduling search strategy and uses tries to implement the table space. Suspension is implemented by leaving the continuation call for the current computation in the table entry corresponding to the variant call being suspended. During this process and as further new answers are found, they are stored in their tables and returned to all variant calls by calling the previously stored continuation calls. We ran our approach against the YapTab system that implements tabling support at the low-level engine. YapTab also implements a suspension-based mechanism, uses tries to implement the table space and is implemented on top of Yap. This is thus a first and fair comparison between the approach of supporting tabling at the low-level engine and the approach of supporting tabling by applying source level transformations coupled with tabling primitives.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

An Efficient Implementation of Linear Tabling Based on Dynamic Reordering of Alternatives

Tabling is a technique of resolution that overcomes some limitations of traditional Prolog systems in dealing with recursion and redundant sub-computations. We can distinguish two main categories of tabling mechanisms: suspension-based tabling and linear tabling. In suspension-based tabling, a tabled evaluation can be seen as a sequence of sub-computations that suspend and later resume. Linear ...

متن کامل

On combining linear-based strategies for tabled evaluation of logic programs

Tabled evaluation is a recognized and powerful technique that overcomes some limitations of traditional Prolog systems in dealing with recursion and redundant sub-computations. We can distinguish two main categories of tabling mechanisms: suspension-based tabling and linear tabling. While suspension-based mechanisms are considered to obtain better results in general, they have more memory space...

متن کامل

Linear tabling strategies and optimizations

Recently there has been a growing interest of research in tabling in the logic programming community because of its usefulness in a variety of application domains including program analysis, parsing, deductive databases, theorem proving, model checking, and logic-based probabilistic learning. The main idea of tabling is to memorize the answers to some subgoals and use the answers to resolve sub...

متن کامل

Towards a Generic Interface to Integrate CLP and Tabled Execution (Extended Abstract)

Logic programming systems featuring Constraint Logic Programming (Jaffar and Ma-her 1994) and tabled execution (Tamaki and Sato 1986; Warren 1992) have been shown to increase the declarativeness and efficiency of Prolog, while at the same time making it possible to write very expressive programs. Previous implementations fully integrating both capabilities (i.e., forcing suspension, answer subs...

متن کامل

An External Module for Implementing Linear Tabling in Prolog

In previous work [1], we have presented a proposal to combine the power of tabling with the Extended Andorra Model (EAM) in order to produce an execution model with advanced control strategies that guarantees termination, avoids looping, reduces the search space, and is less sensitive to goal ordering. To address the integration between tabling and the EAM, through the BEAM system [2], we have ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2007